package com.bayair.doctor.ui.main.left;

import android.graphics.Typeface;
import android.view.View;
import android.view.ViewGroup;

import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.airbnb.lottie.LottieAnimationView;
import com.airbnb.lottie.LottieDrawable;
import com.bayair.doctor.R;
import com.bayair.doctor.adapter.MsgLeftAdapter;
import com.bayair.doctor.base.component.BaseFragment;
import com.bayair.doctor.data.bean.Msg;
import com.bayair.doctor.utils.WidgetUtils;
import com.tencent.qcloud.tim.uikit.component.CustomLinearLayoutManager;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

public class LeftFragment extends BaseFragment {

    private MsgLeftAdapter mAdapter;

    public static LeftFragment newInstance() {
        LeftFragment myFragment = new LeftFragment();
        return myFragment;
    }

    @BindView(R.id.rv_left)
    RecyclerView recyclerView;

    private List<Msg> msgList = new ArrayList<>();

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_left;
    }

    @Override
    protected void initView() {
        mAdapter = new MsgLeftAdapter(msgList);
        View emptyView = getLayoutInflater().inflate(R.layout.view_empty_pushmsg,(ViewGroup) recyclerView.getParent(), false);
        mAdapter.setEmptyView(emptyView);
        mAdapter.openLoadAnimation();
        recyclerView.setAdapter(mAdapter);
        WidgetUtils.bindRecyclerView(recyclerView,mAdapter);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initTitleBar() {
        super.initTitleBar();
        getTitleBar().getLeftView().setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
    }

    @Override
    public void onRightClick(View v) {
        toast("清空");
    }

    @Override
    public void onLazyBeforeView() {
//        msgList.add(new Msg("请联系大Boss患者","2019-12-19 12:12:22"));
//        msgList.add(new Msg("请联系张三丰患者","2019-12-18 12:71:25"));
//        msgList.add(new Msg("请联系殷梨亭患者","2019-12-15 02:11:22"));
//        msgList.add(new Msg("请联系周芷若患者","2019-12-12 16:13:22"));
//        msgList.add(new Msg("请联系张无忌患者","2019-12-09 12:11:22"));
//        msgList.add(new Msg("请联系少林方丈患者","2019-12-19 12:12:22"));
//        msgList.add(new Msg("请联系宋远桥患者","2019-12-18 12:71:25"));
//        msgList.add(new Msg("请联系赵敏患者","2019-12-15 02:11:22"));
//        msgList.add(new Msg("请联系宋青书患者","2019-12-12 16:13:22"));
//        msgList.add(new Msg("请联系谢逊患者","2019-12-09 12:11:22"));
//        msgList.add(new Msg("请联系郭靖患者","2019-12-15 02:11:22"));
//        msgList.add(new Msg("请联系黄蓉患者","2019-12-12 16:13:22"));
//        msgList.add(new Msg("请联系欧阳锋患者","2019-12-09 12:11:22"));
//        mAdapter.setNewData(msgList);
    }

    @Override
    public void onVisible() {
        super.onVisible();
    }
}
